<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <c:set var="path" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	BODY {
		FONT-FAMILY:굴림;
		FONT-SIZE:10pt;
		LINE-HEIGHT:normal;
		TEXT-DECORATION:none;
	}
</style>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript">
	function cancelBoard(no){
		var flag= confirm("취소하시겠습니까?");
		if(flag){
			location.href="board.do?command=boardContentView&no="+no;
		}
	}
	// 수정 버튼
	function confirmBoard(no){
		var contents = $("#contents").val();
		var flag = confirm("수정 완료 했어요?");
		if(flag){
			location.href="board.do?command=boardUpdate&no="+no+"&contents="+contents;
		}
	}
</script>
</head>
<body>
	<c:choose>
		<c:when test="${sessionScope.memberVO==null}">
			<script>
				alert('로그인하세요');
				location.href = "index.jsp";
			</script>
		</c:when>
		<c:otherwise><center>
					글번호 : ${requestScope.boardVO.no }<br>
					글제목 : ${requestScope.boardVO.title }<br>
					조회수 : ${requestScope.boardVO.count }<br>
					글작성날짜 : ${requestScope.boardVO.writtenDate }<br>
					작성자 : ${requestScope.boardVO.writer }<br>
					<img src="${requestScope.boardVO.imgsrc}${requestScope.boardVO.imgfilename}"><br>
					<input type="text"  id="contents" value="${requestScope.boardVO.contents }"><br>
					<c:if test="${requestScope.boardVO.writer==sessionScope.memberVO.id}">
						<img src="${path}/image/board/button/cancel.gif" alt="취소확인" onclick="cancelBoard(${requestScope.boardVO.no})" border="0">
						<img src="${path}/image/board/button/modify_btn.jpg" alt="수정" onclick="confirmBoard(${requestScope.boardVO.no })" border="0">
					</c:if>
					</center>
		</c:otherwise>
	</c:choose>
</body>
</html>